@extends('admin::layouts.master')
@section('style')
<meta name="_token" content="{{ csrf_token() }}"/>
<style>
    .ipaywrap{
        position: relative;
    }
    .tooltip.top{
        top:-31px;
    }
</style>
@stop
@section('content-header')
	
	<h1>
		所有单子({!! $purchase->count() !!})
		&middot;
		<small>{!! link_to_route('admin.purchase.create', '添加') !!}</small>
	</h1>
@stop
@section('content')

   <table class="table">
		<thead>
                <th class="text-center">进货单号</th>
			<th class="text-center">供应商</th>
			<th class="text-center">总金额</th>
			<th class="text-center">进货数量</th>
                        <th class="text-center">进货日期</th>
			<th class="text-center">操作</th>
		</thead>
                <tbody>
                    @foreach ($purchase as $s)
                    <tr @if($s->status==0)class="warning" @endif>
                        <td class="text-center" @if($s->status==0)style="color:#777;" @endif>{!! $s->codeno !!}</td>
                        <td class="text-center" @if($s->status==0)style="color:#777;" @endif>{!! $s->company !!}</td>
                        <td class="text-center" @if($s->status==0)style="color:#777;" @endif>{!! $s->all_price !!}元</td>
                        <td class="text-center" @if($s->status==0)style="color:#777;" @endif>{!! $s->purchase_nums !!}</td>
                        <td class="text-center">{!! $s->created_at->format('Y-m-d') !!}</td>
                        <td class="text-center">
                            @include('admin.common.chakan2', ['data' => $s])
                            <a href="{!! route('admin.purchase.edit', $s->id) !!}">编辑</a>
                            &middot;
                            @include('admin.common.chexiao', ['data' => $s, 'name' => 'purchase','what'=>'单子'])
                        </td>
                    </tr>
                    @endforeach
                </tbody>
</table>

<div class="text-center">
	{!! $purchase->render() !!}
</div>

@stop
@section('script')
<script>

</script>
@endsection